﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using ScrumTable.Common.Collections;

#endregion

namespace ScrumTable.Common.Monitoring
{
    /// <summary>
    /// This interface is used to observe an import status. It can be implemented
    /// for different platforms and frameworks.
    /// </summary>
    /// <remarks>
    /// Caution: The methods may be called in different threads than the calling
    /// thread or main thread!
    /// </remarks>
    public interface IDataImportMonitor
    {
        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        /// <summary>
        /// Calling this method determins that a new sub import progress has
        /// been started. This means that an additional progress bar should
        /// be displayed.
        /// </summary>
        /// <param name="identifier">Specifies the import identifier (handle). This value
        /// references to the ReportProgress / EndSubProgress methods.</param>
        void StartSubProgress(string identifier);

        /// <summary>
        /// Reports a progress associated to an identifier (handle).
        /// </summary>
        /// <param name="identifier">Specifies the import identifier (handle). This value
        ///   references to the StartSubProgress / EndSubProgress methods.</param>
        /// <param name="current">Specifies the current state in percent. The maximum is 100.</param>
        void ReportProgress(string identifier, byte current);

        /// <summary>
        /// Reports a progress associated to an identifier (handle).
        /// </summary>
        /// <param name="identifier">Specifies the import identifier (handle). This value
        ///   references to the StartSubProgress / EndSubProgress methods.</param>
        /// <param name="current">Specifies the current state.</param>
        /// <param name="max">Specifies the maximum.</param>
        void ReportProgress(string identifier, int current, int max);

        /// <summary>
        /// Reports the end of a progress associated to an identifier (handle).
        /// </summary>
        /// <param name="identifier">Specifies the import identifier (handle). This value
        /// references to the StartSubProgress / ReportProgress methods.</param>
        /// <param name="e">This argument will contain an exception if the progress has been aborted.</param>
        void EndSubProgress(string identifier, Exception e = null);

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }
}